package com.example.app.service.impl;

import com.example.app.entity.Emp;
import com.example.app.service.EmpService;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 * @author wangzhuangzhuang
 * @DESC:
 * @date 2022-02-25 13:46
 */

@Service
public class EmpServiceImpl implements EmpService {

	@Override
	public String getEmpInfoByName(String name) {
		return new Emp(name, name.length() / 2 == 0 ? "女" : "男", 23, "Coder").toString();
	}

	@Override
	public List<Emp> getAllEmpInfo() {
		Emp emp01 = new Emp("Wangzz", "男", 22, "Developer");
		Emp emp02 = new Emp("Felix", "男", 23, "Developer");
		Emp emp03 = new Emp("Demo", "女", 22, "UI Designer");
		Emp emp04 = new Emp("Linda", "男", 25, "Developer");
		Emp emp05 = new Emp("Dididi", "男", 29, "Leader");
		return Stream.of(emp01, emp02, emp03, emp04, emp05).collect(Collectors.toList());
	}
}